package structure.composite;

import structure.composite.abstracts.OrganizationComponent;
import structure.composite.components.College;
import structure.composite.components.Department;
import structure.composite.components.University;

public class User {
    public static void main(String[] args) {
        // 由大到小，创建组织
        OrganizationComponent university = new University("MIT");

        OrganizationComponent engineerCollege = new College("Engineer College");
        OrganizationComponent musicCollege = new College("Music College");
        university.add(engineerCollege);
        university.add(musicCollege);

        engineerCollege.add(new Department("soft ware"));
        engineerCollege.add(new Department("computer science"));

        musicCollege.add(new Department("guitar"));

        university.print();
        System.out.println("=============");
        engineerCollege.print();
    }
}
